﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using WLMCoreLibrary;
using SAW_Core;

namespace SAW
{

    public partial class _Default : System.Web.UI.Page
    {
        dbConnector ConexionDB;
        protected override void OnUnload(EventArgs e)
        {
            ConexionDB.CloseConnection();
            base.OnUnload(e);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            ConexionDB = new dbConnector();
            FuncionesLocales.CheckPagePermision(ref ConexionDB);
            CrearMenuPrincipal();
        }

        protected void CrearMenuPrincipal()
        {
            RibbonMenu menu = new RibbonMenu(false,ref ConexionDB);
            MenuContainer.Text = "<ul class=\"menu\">" + menu.GenerarMenu(1, 0, "", "") + "</ul>";
            LabelContenedorPaneles.Text = menu.GenerarPaneles();
            labelScriptPaneles.Text = menu.GenerarScriptPaneles();
        }
    }
}